@direction_4: left;
@direction_3: bottom;
@direction_2: right;
@direction_1: top;
//定义长度
@border_style_width: 5px;
// 数组
@directionList: @direction_4,@direction_1,@direction_2,@direction_3,@direction_4;
//  - 获取列表的长度  length(@bgcardList)  //7
//  - 获取列表元素  extract(@bgcardList, 3)  //c

.border_loop(@start, @end) when(@start <= @end) {
  @directionListIndexValue:  extract(@directionList, @start);
  @directionListNextValue:  extract(@directionList, @start + 1);
  .angle-decorate:nth-of-type(@{start}) {
    border-@{directionListIndexValue}-width: 5px;
    border-@{directionListNextValue}-width: 5px;
    @{directionListIndexValue}: 0px;
    @{directionListNextValue}: 0px;
  }
  .border_loop((@start + 1), @end);
}

.postion-center {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;
  margin: auto;
}

.transform-center {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.enter {
  box-sizing: border-box;
  width: 100%;
  height: 100vh;
  padding: 1rem;

  transform-style: preserve-3d;
  perspective: 30000px;
  transition: background-color .25s ease-in-out;

  .container {
    box-sizing: border-box;
    position: relative;
    width: 100%;
    height: 100%;
    padding: 2rem;
  }

  .angle-decorate {
    position: absolute;
    width: 2rem;
    height: 2rem;
    border-width: 0;
    border-style: solid;
    border-color: black;
    border-radius: 5px;
  }
  .border_loop(1, (length(@directionList) - 1));

  main {
    padding: 0 2.5%;
    height: 100%;
    box-sizing: border-box;
    .left-side {
      width: 47.5%;
      flex-direction: column;
      justify-content: space-between;
      h1 {
        display: inline-block;
        text-transform: uppercase;
        font-style: italic;
        margin-bottom: 4rem;
        font-size: 1.375rem;
        font-weight: bolder;
      }
      h1::after {
        display: block;
        margin: 0 auto;
        margin-top: 0.5rem;
        content: "";
        width: 6rem;
        height: 3.75px;
        background-color: black;
      }

      .title {
        text-transform: uppercase;
        margin-bottom: 0.25rem;
        font-size: 1.125rem;
      }

      .title-att {
        text-transform: capitalize;
        color: #ff4545;
        margin-bottom: 0.25rem;
        font-weight: bold;
      }

      //主要内容
      .content {
        color: #6a6a6a;
        font-style: italic;
        font-size: 0.9rem;
      }

      // 进入按你有
      .enter-btn {
        width: 60%;
        color: white;
        padding: 0.75rem 0;
        text-align: center;
        background-color: black;
        border-radius: 5px;
        text-transform: uppercase;
        font-size: 1.25rem;
        margin-top: 4rem;
        cursor: pointer;
        transition: all 0.125s ease-in-out;
        &:hover {
          background-color: #ff4545;
        }
      }

      .svg-box {
        margin-top: 2rem;
        .icon-gitee {
          transform: scale(1.125);
        }
        svg {
          width: 2.5rem;
          height: 2.5rem;
          cursor: pointer;
        }
      }
    }
    // 右盒子
    .right-side {
      width: 50%;
      margin-left: 2.5%;
      border-radius: 5px;
      background-image: url(https://i.loli.net/2020/11/07/g1WkMCpYB7UTLQ4.jpg);
      background-position: center;
      background-size: cover;
      background-repeat: no-repeat;
      transition: all 1s;
    }
    //中间悬浮盒子
    .center, .center-box {
      .postion-center;
      border-radius: 50%;
    }


    .center {
      background-color: white;
      width: 15rem;
      height: 15rem;
      border: 1px solid black;
      box-shadow: 0 0 2px 0 black inset;
      .center-box  {
        display: flex;
        justify-content: center;
        align-items: center;
        width: 7.5rem;
        height: 7.5rem;
        font-size: 1.25rem;
        background-color: black;
        color: white;
      }
    }


  }
  //弹窗
  .window-pop-up {
    .transform-center;
    z-index: 1000;
  }
  .pop-up-box {
    padding: 1rem 2rem;
    background-color: white;
    border-radius: 5px;
    .qr-code {
      width: 15rem;
      height: 15rem;
      background-size: cover;
      background-position: center;
    }

    .qr-name {
      text-align: center;
      font-size: 1.125rem;
      font-weight: bold;
      margin-top: -0.5rem;
    }
    .qr-number {
      color: rgb(173, 173, 173);
      text-align: center;
      margin: 0.25rem 0;
      span {
        text-transform: uppercase;
      }
    }
    .qr-portrait {
      width: 1.5rem;
      height: 1.5rem;
      border-radius: 50%;
      background-size: cover;
      margin: 0 auto;
      transform: scale(2) translateY(-1rem);
    }
    .close-pop-up-btn {
      width: 2rem;
      height: 2rem;
      text-align: center;
      line-height: 2rem;
      font-size: 0.85rem;
      border-radius: 50%;
      background-color: black;
      color: white;
      border-width: 1px;
      border-style: solid;
      border-color: black;
      cursor: pointer;
      &:hover {
        background-color: white;
        color: black;
      }
      margin: 0.5rem auto 0;
    }
    box-shadow: 0 0 2px 0 rgba(0, 0, 0, 0.568);
  }

  // 过度
  .slide-enter-active , .slide-leave-active{
    transition: all .5s ease-in-out;
  }
  //进入
  .slide-enter-active .pop-up-box {
    transition: transform .5s ease-in-out, opacity 0.25s;
  }
  //离开
  .slide-leave-active .pop-up-box{
    transition: transform .25s ease-in-out, opacity 0.25s;
  }
  
  .slide-enter .pop-up-box, .slide-leave-to .pop-up-box/* .fade-leave-active below version 2.1.8 */ {
    opacity: 0;
    transform: rotate3d(1, 1.5, 0, 45deg);
  }
}

@media(max-width: 1280px) {
  .enter main .right-side {
    background-image: url(https://i.loli.net/2020/11/07/yI78CjlF5QkRLHb.jpg);
  }
}

@media(max-width: 1024px) {
  .enter {
    main {
      flex-direction: column-reverse;
      justify-content: flex-end;
      flex-wrap: nowrap;
      /* 左侧 */
      .left-side  {
        width: 100%;
      }
      /* 右侧 */
      .right-side {
        width: 100%;
        flex-grow: 1;
        //自动适应
        margin-left: 0%;
        background-image: url(https://i.loli.net/2020/11/07/Y2DIiXRypamEktN.jpg);
      }
    }

    // 中间盒子隐藏
    .center {
      display: none;
    }
  }
}

@media(max-width: 780px) {
  .enter main .left-side h1::after{
    margin-left: 0;
  }
}

